$OpenBSD: patch-x11_ui_cpp,v 1.2 2010/06/15 19:04:05 landry Exp $
--- x11/ui.cpp.orig	Wed Mar 19 10:05:38 2003
+++ x11/ui.cpp	Tue Jun 15 20:52:51 2010
@@ -40,9 +40,11 @@ extern "C" {
 #include <X11/Xatom.h>
 }
 
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
+#include <strstream>
 
+using namespace std;
+
 #include "coord.h"
 #include "area.h"
 #include "xdata.h"
@@ -930,7 +932,7 @@ void Ui::menu_enemies_refill_CB(void* value,Viewport*,
   UiP ui = (UiP)closure;
   ui->settingsChanges |= UIenemiesRefill;
   // SGI compiler says you can't cast void* to Boolean.
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   ui->settings.enemiesRefill = val;
 }
 
@@ -939,7 +941,7 @@ void Ui::menu_enemies_refill_CB(void* value,Viewport*,
 void Ui::menu_controls_CB(void* value,Viewport* vPort,void* closure) {
   UiP ui = (UiP)closure;
   int dpyNum = vPort->get_dpy_num();
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.controls[dpyNum]);
   }
@@ -955,7 +957,7 @@ void Ui::menu_learn_controls_CB(void* value,
                                 Viewport* vPort,void* closure) {
   UiP ui = (UiP)closure;
   int dpyNum = vPort->get_dpy_num();
-  Boolean active = (Boolean)(int)value;
+  Boolean active = (Boolean)(intptr_t)value;
 
   if (active) {
     ui->lControls[dpyNum].input = ui->lControls[dpyNum].key = 
@@ -994,7 +996,7 @@ void Ui::menu_learn_controls_CB(void* value,
 
 void Ui::menu_scenarios_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = SCENARIOS;
@@ -1005,7 +1007,7 @@ void Ui::menu_scenarios_CB(void* value,Viewport*,void*
 
 void Ui::menu_levels_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = LEVELS;
@@ -1016,7 +1018,7 @@ void Ui::menu_levels_CB(void* value,Viewport*,void* cl
 
 void Ui::menu_kill_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = KILL;
@@ -1027,7 +1029,7 @@ void Ui::menu_kill_CB(void* value,Viewport*,void* clos
 
 void Ui::menu_duel_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = DUEL;
@@ -1038,7 +1040,7 @@ void Ui::menu_duel_CB(void* value,Viewport*,void* clos
 
 void Ui::menu_extended_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = EXTENDED;
@@ -1049,7 +1051,7 @@ void Ui::menu_extended_CB(void* value,Viewport*,void* 
 
 void Ui::menu_training_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   if (val) {
     ui->settingsChanges |= UIstyle;
     ui->settings.style = TRAINING;
@@ -1070,7 +1072,7 @@ void Ui::menu_quanta_CB(void* value,Viewport*,void* cl
 void Ui::menu_cooperative_CB(void* value,Viewport*,void* closure) {
   UiP ui = (UiP)closure;
   ui->settingsChanges |= UIcooperative;
-  Boolean val = (Boolean)(int)value;
+  Boolean val = (Boolean)(intptr_t)value;
   ui->settings.cooperative = val;
 }
 
@@ -1079,7 +1081,7 @@ void Ui::menu_cooperative_CB(void* value,Viewport*,voi
 void Ui::menu_help_CB(void* value,Viewport* vPort,void* closure) {
   UiP ui = (UiP)closure;
   int dpyNum = vPort->get_dpy_num();
-  Boolean active = (Boolean)(int)value;
+  Boolean active = (Boolean)(intptr_t)value;
 
   if (active) {
     XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.help[dpyNum]);
@@ -1094,7 +1096,7 @@ void Ui::menu_help_CB(void* value,Viewport* vPort,void
 void Ui::status_weapon_CB(void* value,Viewport* vPort,void*) {
   // Some mouse controls.
   //  UiP ui = (UiP)closure;
-  int button = (int)value;
+  intptr_t button = (intptr_t)value;
 
   switch (button) {
   case Button1:
@@ -1113,7 +1115,7 @@ void Ui::status_weapon_CB(void* value,Viewport* vPort,
 
 void Ui::status_item_CB(void* value,Viewport* vPort,void*) {
   //  UiP ui = (UiP)closure;
-  int button = (int)value;
+  intptr_t button = (intptr_t)value;
 
   switch (button) {
   case Button1:
